$(function() {
    $(window).scroll(function() {
            if ($(window).scrollTop() > $(".headerSearchBox").offset().top + $(".headerSearchBox").height()) {
                $(".fixSearchBox").slideDown();
            } else {
                $(".fixSearchBox").slideUp();
            }
        })
        // $(".index-float-condition").on("click", "li" ,function(){
        //     var ele = $(this).clone()
        //     if($(this).text() == "商品"){
        //         $("#searchInput_good").attr({"placeholder":"请输入商品关键词进行搜索","data-id":"1"})
        //     }else if($(this).text() == "企业"){
        //         $("#searchInput_good").attr({"placeholder":"请输入公司名进行搜索","data-id":"2"})
        //     } else if($(this).text() == "采购"){
        //         $("#searchInput_good").attr({"placeholder":"请输入采购标题进行搜","data-id":"3"})
        //     }
        //     $(this).remove();
        //     $(".index-float-condition").prepend(ele);
        //     $(".index-float-condition").removeClass("fixedAuto");
        // })
        // $(".index-float-condition").hover(function(){
        //         $(this).addClass("fixedAuto")
        //     },function(){
        //         $(this).removeClass("fixedAuto")
        // })
    $(".chosefloat,.foption").hover(function() {
        $('.foption').attr('style', 'display:block;')
        $('.chosefloat .layui-icon').removeClass('layui-icon-down').addClass('layui-icon-up')
    }, function() {
        $('.foption').attr('style', 'display:none')
        $('.chosefloat .layui-icon').removeClass('layui-icon-up').addClass('layui-icon-down')
    })
    $(".foption").on("click", "li", function() {
        if ($(this).text() == "商品") {
            $("#searchInput_good").attr({ "placeholder": "请输入商品关键词进行搜索", "data-id": "1" })
        } else if ($(this).text() == "企业") {
            $("#searchInput_good").attr({ "placeholder": "请输入企业名进行搜索", "data-id": "2" })
        } else if ($(this).text() == "采购") {
            $("#searchInput_good").attr({ "placeholder": "请输入采购标题进行搜索", "data-id": "3" })
        }
        var ele = $(this).clone();
        var choseele = $('.chosefloat li').replaceWith(ele)
        $(this).replaceWith(choseele)
    })
    $("#searchInput_good").keydown(function(event) {
        if (event.keyCode == 13) {
            $("#searchBtn_good").click();
        }
    })
    $("#searchBtn_good").click(function() {
        //      alert(3)
        if (!$("#searchInput_good").val()) {
            return false
        }
        //  alert(2)
        switch ($(this).siblings(".sousuoinput").attr("data-id")) {
            case "2":
                window.open("/search/shop.html?keyword=" + encodeURI(encodeURI($(this).siblings(".sousuoinput").val())))
                break;
            case "3":
                window.open("/search/business.html?keyword=" + encodeURI(encodeURI($(this).siblings(".sousuoinput").val())))
                    //   window.location.href = 
                break;
            default:
                window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).siblings(".sousuoinput").val())))


        }

    })
    var navEle = $('.index_left_saber li').on('click', function() {

        $('html,body').animate({
            scrollTop: $(this).attr('data-top')
        }, 500);
    });

    $(window).scroll(function(event) {
        if ($(window).scrollTop() >= 580) {
            navEle.parent().addClass('fixed_saber')
        } else {
            navEle.parent().removeClass('fixed_saber')
        }


        if ($(window).scrollTop() >= 520 && $(window).scrollTop() < 800) {
            navEle.eq(0).hasClass('active') || navEle.eq(0).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 800 && $(window).scrollTop() < 1225) {
            navEle.eq(1).hasClass('active') || navEle.eq(1).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 1225 && $(window).scrollTop() < 2482) {
            navEle.eq(2).hasClass('active') || navEle.eq(2).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 2482 && $(window).scrollTop() < 3310) {
            navEle.eq(3).hasClass('active') || navEle.eq(3).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 3310 && $(window).scrollTop() < 3880) {
            //      alert(2)
            navEle.eq(4).hasClass('active') || navEle.eq(4).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 3880 && $(window).scrollTop() < 4260) {
            navEle.eq(5).hasClass('active') || navEle.eq(5).addClass('active').siblings().removeClass('active')
        } else if ($(window).scrollTop() >= 4260) {
            navEle.eq(6).hasClass('active') || navEle.eq(6).addClass('active').siblings().removeClass('active')
        }
    })
    if ($.cookie("qqt-access-token") && $.cookie("member-base-info")) {
        var userInfo = JSON.parse($.cookie("member-base-info"))

        $('#purchase_phone').val(userInfo.linkmanPhone ? userInfo.linkmanPhone : userInfo.mobile)
        $('#purchase_linkname').val(userInfo.linkman ? userInfo.linkman : userInfo.companyName)
    }
    $('.identity_list').on('click', 'li', function() {
        $(this).addClass('active').siblings().removeClass('active')
        $('.ban_enter').hide().eq($(this).index()).show()
    })
    utils.ajaxGet("/b2b-system/setting/notices", {}, function(res) {
        if (res.data.length > 0) {
            var ele = $('.text_auto')
            ele.find('a').attr('href', res.data[0].url).find('span').text(res.data[0].title)

            $.each(res.data, function(k, v) {
                if (k != 0 && k < 4) {

                    var str = '<a class="go_news" target="_blank" href="' + v.url + '">' + v.title + '</a>';
                    ele.after(str)
                }

            })
            $(".text_go").textScroll()

        }
    }, function() {

    })
    $('.purchase_form_btn').on('click', function() {
        $(this).parents('.purchase_form').find('input').blur()
        if ($(this).parents('.purchase_form').find(".error").length == 0) {
            captcha1.show();
        }
    })

    function vIpnut(ele, type) {
        switch ($(ele).attr("name")) {
            case "purchase_name":
                checkInput($(ele), utils.emptyRegExp)
                    // if($(this).val()){
                    //     findSensitiveword($(this).val(), 'linkman',7)
                    // }
                break;
            case "purchase_linkname":
                checkInput($(ele), utils.emptyRegExp)
                    // if($(this).val()){
                    //     findSensitiveword($(this).val(), 'linkman',7)
                    // }
                break;

            case "purchase_phone":
                checkInput($(ele), utils.phoneRegExp, 2)
                break;



        }
    }
    $('.purchase_form input').on('blur', function() {
        //      alert(3)
        vIpnut(this)
    })

    function checkInput(inputEle, regExpval, phone_type) {
        if (!(regExpval.test(inputEle.val()))) {

            inputEle.parent().next(".ly_error_tip").text(inputEle.attr("data-text"));
            inputEle.addClass("error");

            phone_type == 2 && inputEle.val() !== '' && inputEle.parent().next(".ly_error_tip").text("请填写正确的手机号");
        } else {
            inputEle.parent().next(".ly_error_tip").text("");
            inputEle.removeClass("error")
            inputEle.removeClass("f_error")

        }

    }
    $('.purchase_success_btn').click(function() {
        $('.purchase_form_content').show()
        $('.purchase_form_success').hide()
    })
    var captcha1 = new TencentCaptcha(utils.captchaAppId, function(res) {

        // res（用户主动关闭验证码）= {ret: 2, ticket: null}
        // res（验证成功） = {ret: 0, ticket: "String", randstr: "String"}
        if (res.ret === 0) {
            layer.load();

            var params = {
                businessOpportunity: {
                    linkman: $('#purchase_linkname').val(),
                    phone: $('#purchase_phone').val(),
                    sourceUrl: location.href,
                    type: 1,
                    businessOriginalityId: '-1',
                    dataSource: 5
                },
                businessMaterials: [{
                    name: $('#purchase_name').val(),
                    purchaseCountStr: '1',
                    unit: '件'
                }],
                ticket: res.ticket,
                randStr: res.randstr,
                userIp: ""
            }
            params.businessOpportunity = utils.getTracking(params.businessOpportunity)
            params.businessPurchaseRequest = utils.getTracking(params.businessPurchaseRequest)
                //    return;
            utils.ajaxPost('/business/web/business_opportunity', params, function(res) {

                $('#purchase_linkname').val('')
                $('#purchase_phone').val('')
                $('#purchase_name').val('')
                if ($.cookie("member-base-info")) {
                    var userInfo = JSON.parse($.cookie("member-base-info"))

                    $('#purchase_phone').val(userInfo.linkmanPhone ? userInfo.linkmanPhone : userInfo.mobile)
                    $('#purchase_linkname').val(userInfo.linkman ? userInfo.linkman : userInfo.companyName)
                }
                layer.closeAll('loading');
                //  layer.toast('提交成功')
                $('.purchase_form_content').hide()
                $('.purchase_form_success').show()

                // showSuccess(function() {
                //     window.location.reload()
                // })
            }, function(res) {
                // targetForm.find(".toast_pop").text(res.msg).show();
                layer.alert(res.msg)
                layer.closeAll('loading');
                return false
            })



        }
    });

    function createHotItem(item) {
        return $(`<dl data-id="${item.id}" data-type="${item.type}">
                     <dt>
                         <span class="purchase_date">${item.day>99?'99+':item.day}</span>
                     </dt>
                    <dd>
                         <h4><b>采购</b><span class="purchase_name">${item.title}</span></h4>
                        <p>${item.companyName}</p>
                    </dd>
               </dl>`)
    };

    utils.ajaxGet("/goods/web/hot-goods-info", {}, function(res) {
        var imgCount = 0;
        var eleWrap = $('.hot_product_list').on('click', '.hot_product_item', function() {
            window.open($(this).attr('data-url'))
        })

        $.each(res.data, function(k, v) {
            var picUrl = v.picUrl.indexOf('?') == -1 ? v.picUrl : v.picUrl + '&' + 'c' + (imgCount += 1);
            var ele = $(`<dl class="hot_product_item ${v.videoUrl&&'has_video'}" data-url="./offer/goods-detail.html?id=${v.id}&memberId=${v.memberId}">
                        <dt style="background:url(${picUrl});background-size:100% 100%">

                        </dt>
                        <dd>
                            <p class='product_content'>
                               ${v.title}
                            </p>
                            <p class="product_info">
                                <span class="price"><b>￥</b>${v.price<=0?'面议':utils.Pricemake(v.price)}</span>
                                <span class="addr">${utils.Citymake(v.base,v.city)}</span>
                            </p>
                        </dd>
                    </dl>`)
            eleWrap.append(ele)

        })



    })
    utils.ajaxGet("/goods/web/video-goods-info", {}, function(res) {
        var imgCount = 0;

        var eleWrap = $('.video_products').on('click', '.video_product_item', function() {
            //location.href = $(this).attr('data-url')
            window.open($(this).attr('data-url'))
        }).on('click', 'h4', function() {
            window.open($(this).attr('data-url'))
            return false;
        })
        var videoList = [];

        //    console.log(res.data, 222)
        $.each(res.data, function(k, v) {
            videoList.push(v.id + '&' + v.memberId)
            var picUrl = v.picUrl.indexOf('?') == -1 ? v.picUrl : v.picUrl + '&' + 'a' + (imgCount += 1);
            var ele = $(`<div class="video_product_item"  data-url="./video/index.html?id=${v.id}&memberId=${v.memberId}">
                <h4  data-url="./shop/index.html?memberId=${v.memberId}"><img src="${v.logoPic}">${v.companyName}</h4>
                <div class="video_img" style="background:url(${picUrl}) center center no-repeat;background-size:288px 288px ">
                    <div class="video_mask">
                        <img src='https://style.51caigou.com/mall/img/index/video.png'>
                    </div>
                </div>
                <p class="video_text">${v.title}</p>
            </div>`)

            eleWrap.append(ele)

        })

        localStorage.setItem('videoList', videoList.join(','))

    })
    utils.ajaxGet("/goods/web/hot-member-goods-info", {}, function(res) {
        var imgCount = 0;
        var eleWrap = $('.shops_list').on('click', '.shops_title', function() {
            window.open($(this).siblings('a').attr('href'))
                //  location.href =
        })
        $.each(res.data, function(k, v) {
            var eleItem = $(`<div class="shpos_item">
            <h4><span class="shops_title">${v.hotMemberInfoVO.companyName}</span><a target="_blank" href="./shop/index.html?memberId=${v.hotMemberInfoVO.memberId}">进入店铺</a></h4>
                <p class="shops_info">经营地址：<span>${v.hotMemberInfoVO.base+' '+v.hotMemberInfoVO.city}</span> 经营年限：<span>${v.hotMemberInfoVO.operationTime}</span></p>
                <div class="shop_product_list">
                
                </div>
                <p class='shop_keywords'>主营产品： </p>
                </div>`)
            $.each(v.hotMemberInfoVO.mainProduct.split(','), function(key, value) {
                eleItem.find('.shop_keywords').append('<span>' + value + '</span>')
            })

            $.each(v.hotMemberGoodsVOS, function(key, value) {
                var picUrl = value.url.indexOf('?') == -1 ? value.url : value.url + '&' + 'b' + (imgCount += 1);
                var ele = $(`<div data-url='./offer/goods-detail.html?id=${value.goodsId}&memberId=${v.hotMemberInfoVO.memberId}' class="shop_product_item item_href"><p>${value.title}<br>￥ ${value.price<=0?'面议':utils.Pricemake(value.price)}</p></div>`)
                ele.css({
                    'background': 'url(' + picUrl + ')',
                    'backgroundSize': '100% 100%'
                })
                eleItem.find('.shop_product_list').append(ele)
            })
            eleWrap.append(eleItem)

            // <div class="shop_product_item">
            //     <p>双宫茧蚕丝被3斤…<br>￥ 2689</p>
            // </div>
            // <div class="shop_product_item">
            //     <p>双宫茧蚕丝被3斤…<br>￥ 2689</p>
            // </div>
        })
        eleWrap.on('click', '.shop_product_item', function() {
            //     location.href = 
            window.open($(this).attr('data-url'))
        })

    })
    utils.ajaxGet("/business/web/inquiry-hot", {}, function(res) {

        var hotWrap = $('#purchase_swiper').find('.swiper-wrapper').on('click', 'dl', function() {
            if ($(this).attr('data-type') == 3) {
                window.open('./business/zbdetail.html?id=' + $(this).attr('data-id'))
            } else if ($(this).attr('data-type') == 1) {
                window.open('./business/xjdetail.html?id=' + $(this).attr('data-id'))
            }

        });
        $.each(res.data, function(k, v) {
            if (k % 2 == 0) {
                var ele = $('<div class="swiper-slide"><div class="purchase_items"></div></div>')
                ele.find('.purchase_items').append(createHotItem(v));
                // if (!res.data[k + 1]) {
                //     return
                // }
                res.data[k + 1] && ele.find('.purchase_items').append(createHotItem(res.data[k + 1]))
                hotWrap.append(ele)
            }

        })
        var swiper = new Swiper('#purchase_swiper', {

            slidesPerView: 3,
            paginationClickable: true,
            spaceBetween: 12,
            direction: 'vertical',
            speed: 1000,
            autoplay: 3000,
            loop: res.data.length > 6
        });
        $('#purchase_swiper').on('mouseover', function() {
                swiper.stopAutoplay();
            })
            .on('mouseleave', function() {
                swiper.startAutoplay();
            })
            // swiper.el.onmouseover = function() { //鼠标放上暂停轮播
            //     console.log(1)
            //     swiper.autoplay.stop();
            // }
            // swiper.el.onmouseleave = function() {
            //     swiper.autoplay.start();
            // }

    }, function() {

    })

    //  /business/xjdetail.html?
    var countCXArr = [];
    var countCX = function() {
        $('.numCount').each(function(i, dom) {
            if (countCXArr[i] && countCXArr[i] === true) {
                return;
            }
            var sT;
            var ncTop;
            sT = $(window).scrollTop();
            ncTop = $(dom).offset().top;
            var id, decimals, startVal, endVal, duration;
            if (sT > ncTop - $(window).height() && sT < ncTop) {
                $(dom).find('.numCX').each(function() {
                    id = $(this).attr('id');
                    decimals = $(this).attr('data-decimals'),
                        startVal = $(this).attr('data-startVal'),
                        endVal = $(this).attr('data-endVal'),
                        duration = $(this).attr('data-speed');
                    new CountUp(id, startVal, endVal, decimals, duration, {
                        useEasing: true, //效果
                        separator: '' //数字分隔符
                    }).start(); // target：目标元素id, startVal：你想要开始的值, endVal：你想要到达的值, decimals：小数位数，默认值为0, duration：动画持续时间为秒，默认值为2, options：选项的可选对象
                    countCXArr[i] = true;
                })
            }
        })
    }
    countCX();
    $(window).on("scroll", function() {
        countCX();
    })
    var imgsWrap = $('.partners_item')
    $('.partners_title li').on('click', function() {
        imgsWrap.empty()
        var self = $(this);
        self.addClass('active').siblings().removeClass('active')
        if (self.attr('data-length') > 12) {
            var nums = self.attr('data-nums')
            if (!nums) {
                var arr = [],
                    resultList = [];
                for (var i = 1; i <= self.attr('data-length'); i++) {
                    arr.push(i)
                }
                var arrLength = arr.length * 1;
                for (var o = 1; o <= 12; o++) {
                    //  var key = Math.floor(Math.random() * arr.length)

                    var key = Math.floor(Math.random() * arr.length)

                    resultList.push(arr[key])
                    arr.splice(key, 1)

                }
                self.attr('data-nums', resultList.join(','))
                nums = self.attr('data-nums')
            }
            var imgs = nums.split(',')


        } else {
            var imgs = [];

            for (var i = 1; i <= self.attr('data-length'); i++) {
                imgs.push(i)
            }
        }
        $.each(imgs, function(k, v) {
            imgsWrap.append('<img src="https://style.51caigou.com/mall/img/index/partners_' + (self.index() + 1) + '/' + 'img (' + v + ').png">')
        })
    }).eq(0).click()


    if ($.cookie("qqt-access-token")) {
        $(".weiDl").hide();
        $(".YDL").show();
        let login_info = JSON.parse($.cookie("qqt-login-info"))
        let member_info = $.cookie("member-base-info") ? JSON.parse($.cookie("member-base-info")) : {}
        if (!member_info.memberId) {
            $('.login_default').hide()
            $(".logo02_1").show().addClass("logo02_1_login")
            $("#qqt_name").text(login_info.phone)
                //   return;
        } else {
            memberBaseInfo(member_info.memberId) //进入首页刷新一次企业信息
        }

    }

})

getIndexBanner(10) //获取大banner
getIndexBanner(20) //获取大banner
    // getIndexBusinesses() //获取企业采购
    // getzhaobiaodata() //获取企业采购招标
getLinks() //获取友情链接
    /* 是否登录 */

$(".hyzxBtn").attr("href", "//" + utils.getUserHostName())
$("#loginBtn").click(function() {
    //  alert(1)
    window.open("./login/login.html?forword=" + encodeURIComponent(window.location.href))
        //window.location.href =
})
$(".registerBtn").click(function() {
    window.open("./login/register.html?forword=" + encodeURIComponent(window.location.href))
        //window.location.href =
})
$("#out_btn").click(function() {
        utils.clearLoginCookie();
        window.location.href = window.location.href
    })
    /* 是否登录 */

/** 战略合作 */
var mySwiper = new Swiper('.zlhz-swiper-container', {
        loop: true, // 循环模式选项
        autoplay: 5000,
        slidesPerView: 8,
        spaceBetween: 10,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
    })
    /** 战略合作 */


/* 悬浮搜索框 */
$(window).scroll(function() {
    if ($(window).scrollTop() > $(".headerSearchBox").offset().top + $(".headerSearchBox").height()) {
        $(".fixSearchBox").slideDown();
    } else {
        $(".fixSearchBox").slideUp();
    }
})
$(".index-float-condition").on("click", "li", function() {
    var ele = $(this).clone()
    if ($(this).text() == "商品") {
        $("#searchInput1_2").attr({ "placeholder": "请输入商品关键词进行搜索", "data-id": "1" })
    } else if ($(this).text() == "企业") {
        $("#searchInput1_2").attr({ "placeholder": "请输入企业名进行搜索", "data-id": "2" })
    } else if ($(this).text() == "采购") {
        $("#searchInput1_2").attr({ "placeholder": "请输入采购标题进行搜", "data-id": "3" })
    }
    $(this).remove();
    $(".index-float-condition").prepend(ele);
    $(".index-float-condition").removeClass("fixedAuto");
})
$(".index-float-condition").hover(function() {
        $(this).addClass("fixedAuto")
    }, function() {
        $(this).removeClass("fixedAuto")
    })
    /* 悬浮搜索框 */

/* 点击分类数据 */
$(".index_yijifenlei,.index_erjifenlei>a,.index_sanjijifenlei>a").click(function() {
    window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).text())))
})
$(".fenleituijian>li").click(function() {
    window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).children("span").text())))
})
$(".layui-breadcrumb a").click(function() {
        window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).text())))
    })
    /* 点击分类数据 */
    /* 点击热门行业 */
$(".hy_first").click(function() {
    window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).find("p:eq(0)").text())))
})
$(".hy_second>li").click(function() {
    window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).find("h6").text())))
})
$(".hy_third>a").click(function() {
        window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).text())))
    })
    /* 点击热门行业 */



/* 点击搜索 */
$("#searchInput1_2").keydown(function(event) {
        if (event.keyCode == 13) {
            $("#searchBtn1_2").click();
        }
    })
    //获取友情链接
function getLinks() {
    utils.ajaxGet("/b2b-system/setting/links", {}, function(res) {
        if (res.data.length > 0) {
            var str = ''
            $.each(res.data, function(index, item) {
                str += `
                    <a href="${item.url}" target="_blank">${item.name}</a>
                `
            })
            $("#YQ_LINKS").html(str);
            layui.use('element', function() {
                var element = layui.element;
                element.init();
            });
        }
    }, function() {

    })
}

$("#searchBtn1_2").click(function() {
        //  alert(2)
        if (!$("#searchInput1_2").val()) {
            return false
        }
        switch ($(this).siblings(".searchInput").attr("data-id")) {
            case "2":
                window.open("/search/shop.html?keyword=" + encodeURI(encodeURI($(this).siblings(".searchInput").val())))
                break;
            case "3":
                window.open("/search/business.html?keyword=" + encodeURI(encodeURI($(this).siblings(".searchInput").val())))
                    //   window.location.href = 
                break;
            default:
                window.open("/search/goods.html?keyword=" + encodeURI(encodeURI($(this).siblings(".searchInput").val())))

                // window.location.href = 

        }
    })
    /* 点击搜索 */


/* 获取banner图 */
function getIndexBanner(type) {
    let query = {
        type: type
    }
    utils.ajaxGet("/b2b-system/setting/banners", query, function(res) {
        if (res.data.length > 0) {
            if (type == 10) {
                var str = ''
                $.each(res.data, function(index, item) {
                    str += `
                        <div class="swiper-slide" style="background: url(${item.imageUrl}) no-repeat top center;">
                    `
                    if (item.url) {
                        str += `
                            <a href="${item.url}" target="_blank"></a>
                        `
                    }
                    str += `
                        </div>
                    `
                })
                $("#indexBanner").html(str);
                /** banner */
                var mySwiper = new Swiper('.home-swiper-container', {
                        loop: true, // 循环模式选项
                        autoplay: 3000,
                        speed: 800,
                        pagination: '.swiper-pagination',
                        nextButton: '.swiper-button-next',
                        prevButton: '.swiper-button-prev',
                    })
                    /** banner */
            } else {
                var small_banner = "";
                if (res.data[0].url) {
                    $("#small_banner").html(`<a href="${res.data[0].url}" target="_blank"><img src="${res.data[0].imageUrl}" /></a>`)
                } else {
                    $("#small_banner").html(`<img src="${res.data[0].imageUrl}" />`)
                }
            }

        }
    }, function() {

    })

}
// 点击 企业采购 tab切换
$("#qycg_tab li").click(function() {
        $(this).addClass('cur').siblings().removeClass('cur')
        var evetabid = $(this).attr('tabid') - 1;
        $('#qycg_tabcont').find(".qycg_ul:eq(" + evetabid + ")").show().siblings().hide()
    })
    /* 获取企业采购模块数据 */

//获取友情链接


/* 获取企业基本信息 */
function memberBaseInfo(memberId) {
    let data = {
        memberId: memberId
    }
    utils.ajaxGet("/member/member-base-info?" + $.param(data), '', function(res) {

        //$.cookie("member-base-info",JSON.stringify(res.data), { expires: 1, path: '/' })
        //  utils.setLoginCookie("member-info", res.data)
        let member_info = JSON.parse($.cookie("member-base-info"))
        if (member_info.logoPic) {
            $("#avatar").attr("src", member_info.logoPic)
        }
        $('.login_default').hide()
        $(".logo02_1").show().addClass("logo02_1_login")
        $("#qqt_name").text(member_info.companyName)
    }, function() {

    })
}